package com.hxd.otc.module.my.bean;

import com.hxd.otc.R;
import com.hxd.otc.utils.ResourceUtil;

import java.io.Serializable;

/**
 * Created by lzy on 2018/6/27 0027.
 * description ${版本信息bean}
 */
public class AppInfoBean implements Serializable {

    private String id;
    private String type;
    private String version;// code
    private String comment;// code
    private int versionValue;// Value
    private String address;
    private int isUpgrade;//'是否强制更新, 0: 不强制 1: 强制'


    public String getComment() {
        return comment;
    }

    public void setComment(String comment) {
        this.comment = comment;
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public String getVersion() {
        return version;
    }

    public void setVersion(String version) {
        this.version = version;
    }

    public int getVersionValue() {
        return versionValue;
    }

    public void setVersionValue(int versionValue) {
        this.versionValue = versionValue;
    }

    public String getAddress() {
        return address;
    }

    public void setAddress(String address) {
        this.address = address;
    }

    public int getIsUpgrade() {
        return isUpgrade;
    }

    public void setIsUpgrade(int isUpgrade) {
        this.isUpgrade = isUpgrade;
    }

    @Override
    public String toString() {
        return "AppInfoBean{" +
                "id='" + id + '\'' +
                ", type='" + type + '\'' +
                ", version=" + version +
                ", versionValue='" + versionValue + '\'' +
                ", address='" + address + '\'' +
                ", isUpgrade='" + isUpgrade + '\'' +
                '}';
    }

    public String getSaveName() {
        return ResourceUtil.getString(R.string.app_name) + "_" + versionValue + "_v" + version + ".apk";
    }

    public boolean isForceUpdate() {
        return isUpgrade == 1;
    }
}
